package com.yuyou.train.lesson.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.train.lesson.mapper.LessonClassUserRelationMapper;
import com.yuyou.train.lesson.service.ILessonClassUserRelationService;
import com.yuyou.train.service.api.lesson.entity.LessonClassUserRelation;
import com.yuyou.train.util.tool.Sequence;
import com.yuyou.train.util.tool.UUIDUtil;

@Service
public class LessonClassUserRelationServiceImpl implements ILessonClassUserRelationService{

	@Autowired
	private LessonClassUserRelationMapper  lessonClassUserRelationMapper;
	
	@Override
	public int deleteByPrimaryKey(String id) {
		return lessonClassUserRelationMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(LessonClassUserRelation record) {
		record.setId(Sequence.getSequence().getNextId());
		record.setCreateTime(new Date());
		return lessonClassUserRelationMapper.insert(record);
	}

	@Override
	public LessonClassUserRelation selectByPrimaryKey(String id) {
		return lessonClassUserRelationMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(LessonClassUserRelation record) {
		return lessonClassUserRelationMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<LessonClassUserRelation> findLessClsUserRelation(
			LessonClassUserRelation record) {
		return lessonClassUserRelationMapper.findLessClsUserRelation(record);
	}

	@Override
	public int deleteByClassIdAndType(String classId,String type) {
		return lessonClassUserRelationMapper.deleteByClassIdAndType(classId,type);
	}

	@Override
	public LessonClassUserRelation selectLastFinishClass(String userId) {
		return lessonClassUserRelationMapper.selectLastFinishClass(userId);
	}


}